<%--
  Created by IntelliJ IDEA.
  User: CVV
  Date: 2018/6/25
  Time: 13:47
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>
<html>
<head>
    <title>登录 - 物流管理系统</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script type="text/javascript" src="script/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="script/common.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("#button").click(function () {
                var username = $("#user").val();
                var password = $("#password").val();
                var code = $("#code").val();
                $.ajax({
                    type: "get",
                    url: "user/login",
                    data: {"password": password, "user": username, "verifyCode": code},
                    success:function(res) {
                        alert(res);
                        if (res == "登录成功！") {
                            window.location.href = "index.jsp";
                        }
                        else
                            return false;
                    },
                    error:function(res) {
                    	alert(res);
                        alert("响应失败");
                    }
                })
            })
        })
    </script>
    <style media="all" type="text/css">@import "style/all.css";</style>
</head>
<body style="background-color: #FFFFFF">
<br>
<br>
<br>
<br>
<br>
<br>
    <table align="center" background="style/img/logon.gif" border="0" cellpadding="0" cellspacing="0" height="118" width="297">
        <tr>
            <td colspan="2" height="68"></td></tr>
        <tr>
            <td align="center" height="30" width="35%">
                帐  号：
            </td>
            <td width="65%">
                <input id="user" name="user" size="20" type="text">
            </td>
        </tr>
        <tr>
            <td align="center" height="30" width="35%">
                密  码：
            </td>
            <td width="65%">
                <input name="password" id="password" size="20" value="" type="password">
            </td>
        </tr>
        <tr>
            <td align="center" height="30" width="35%"> 附加码：</td>
            <td width="65%">
                <input  id="code" name="verifyCode" maxlength="10" size="10">请输入：<b><font color="RED"><img alt="点我刷新" src="ValidateColorServlet" onclick="javascript:location.reload()"></font>
            </b></td>
        </tr>
        <tr>
            <td colspan="2" align="center" height="50">
                <input id="button" type="button" name="Submit" value="登陆" class="button" />
            </td>
        </tr>
        <tr><td colspan="2" height="35">&nbsp;</td></tr>
    </table>

</body>
</html>
